<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./vue2.js"></script>
    <div id="box">
        <div><input type="text" v-model="text"/></div>
        <div><input type="checkbox" v-model="isStatus"/>记住密码</div>
        <div><button @click="handleClick">登录</button></div>
        <h2>用户注册：</h2>
        <input type="checkbox" v-model="checkboxList" value='vue'>Vue
        <input type="checkbox" v-model="checkboxList" value="react">React
        <input type="checkbox" v-model="checkboxList" value="微信小程序">微信小程序
        <h3>性别选择：</h3>
        <input type="radio" v-model='select' value='男'/>男
        <input type="radio" v-model='select' value='女'/>女
        <input type="radio" v-model='select' value='人妖'/>人妖
    </div>
    <script>
      let vm=  new Vue({
            el:'#box',
            data:{
                text:localStorage.getItem('username'),
                isStatus:false,
                checkboxList:[],
                select:'男'
            },
            methods:{
                handleClick(){
                    if(this.isStatus){
                        localStorage.setItem('username',this.text)
                        console.log(this.text,this.checkboxList,this.select);
                    }
                }
            }
        })
    </script>
</body>
</html>